package timer;

import java.util.TimerTask;

public class OOS extends TimerTask
{
    private static boolean isRunning = false;
    Task task = new TaskImpl();

    @Override
    public void run()
    {
        if (!isRunning){
        	System.out.println("The last task is running...");
        }
        isRunning = true;
        //System.out.println("Timer start...");
        lauch(); /* 业务代码 */
        isRunning = false;
       // System.out.println("Timer end!");
    }
    
    //业务
    private void lauch(){
        task.excute();
    }

}
